﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LitJson;
using OestsCommon.Model;
using LNet;
using OestsDataBase;
using OestsServer.Net;

namespace OestsServer.Handlers.OESPHandlers
{
	public class ModifyChoiceHandler : HandlerBase<OESPClientChannel>
	{
		public override PacketKey PKey => PacketKey.ModifyChoice;

		public override void Execute(OESPClientChannel client, Request resquestPacket)
		{
			Choice choice = JsonMapper.ToObject<Choice>(resquestPacket.DataStr);
			SubjectChoiceDAL.Modify(choice);
			ResponsePacket.DataObject = choice;
			client.Send(ResponsePacket);
		}
	}
}
